
#ifndef SERVER_H_
#define SERVER_H_

#ifdef _cplusplus
extern "C" {
#endif

#include "callback.h"

struct core;
struct session;

#define SERVER_ERR_LEN	256

typedef struct server {
	int id;
	int fd;
    int port;
    char neterr[SERVER_ERR_LEN];
    char* bindaddr;
	struct core* core;
	IServerCallBack* serverCallBack;
    void* privateData;
} server;

server* initServer(struct core* c, char *err, int port, char *bindaddr);
void destroyServer(server* s);

#ifdef _cplusplus
}
#endif

#endif /* SERVER_H_ */
